<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" />
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/use-dynamic-mount@1.0.4/dist/index.umd.min.js"></script>
    <script src="./dist/index.umd.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script>
      Vue.use(useDynamicMount(), {
        name: '$dialog',
        extend: window.QuickElDialog.default,
        nextTick() {
          this.visible = true
        }
      })
      new Vue({
        el: '#app',
        data: function () {
          return { visible: false }
        },
        mounted() {
          this.$dialog({
            component: {
              mounted() {
                console.log('render')
              },
              render(h) {
                return h('button', 1)
              }
            }
          })
        }
      })
    </script>
  </body>
</html>
